<%@page import="com.jacen.fzxs.manager.BaseInterceptor"%>
<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="jt" uri="http://jacen.com/jsp/tag"%>
<%
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath() + "/";
	pageContext.setAttribute("basePath", basePath);
%>
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head>
	<title>福建青年墙体资源管理系统</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
	<base href="<%=basePath%>" />
    <!-- CSS -->
    <link rel="stylesheet" href="<%=basePath%>assets/css/reset.css">
    <link rel="stylesheet" href="<%=basePath%>assets/css/supersized.css">
    <link rel="stylesheet" href="<%=basePath%>assets/css/style.css">
    
    <script src="<%=basePath%>assets/js/jquery-1.8.2.min.js" ></script>
    <script src="<%=basePath%>js/jquery.form.js" type="text/javascript"></script>
    <script src="<%=basePath%>assets/js/supersized.3.2.7.min.js" ></script>
    <script src="<%=basePath%>assets/js/supersized-init.js" ></script>
    <script src="<%=basePath%>assets/js/scripts.js" ></script>
	<script type="text/javascript">
        var href = location.href;
        var parentHref = parent.location.href;
        if("${error }"!="-1"){
        	if("${error }"=="0"){
            	alert("登陆失效，请重新登陆");
            }
            if("${error }"=="1"){
            	if("${url }"!="none")
            		alert("用户无权限访问:${url}");
            }
        };
        
        if(parentHref != href && href.indexOf("login.do") != -1) parent.location.href = "login.do";
	
		$(document).ready(function () {
			$.ajaxSetup ({ cache:false, async:false});
			
			$("#username").focus();
			
            var options = {dataType: 'json', success : process};
		 	$("#loginForm").submit(function(){
                $(this).ajaxSubmit(options);
                return false;
		 	});

		 	$("#visitor").click(function(){
		 		$("#username").val("visitor");
                $("#password").val("123456");
                $("#loginForm").submit();
		 	});
		 });

		 function process(responseJson) {
            if(responseJson.code == 0) {
            	alert(responseJson.message);
            	$("#username").focus();
                $("#vericode-img").click(); 
                $("#username").val(null);
                $("#password").val(null);
                return;
            }
            location.href = "index.do";
		 }
	</script>
</head>

<body class="page-container" >
	 <div  >
            <form action="login.do" method="post" id ="loginForm">
	            <table align="center" style="">
	            	<tr>
	            		<td colspan="2"><input type="text" name="username" id="username" class="loginput image1" value="admin" placeholder="用户名" /></td>
	            	</tr>
	            	<tr>
	            		<td colspan="2"><input type="password" name="password" id="password" class="loginput image2" value="888888" placeholder="用户密码" /></td>
	            	</tr>
<!-- 	            	<tr> -->
<!-- 	            		<td colspan="2" valign="top" > -->
<!-- 	            			<input type="text" name="vericode" id="vericode" class="loginput image3" style="width: 150px;float: left;"  placeholder="验证码" /> -->
<!-- 	            			<img id="vericode-img" src="" style="margin-left: 50px;" class ="vericode-img" title="点击我刷新"  /></td> -->
<!-- 	            	</tr> -->
	            	<tr>
	            		<td colspan="2"  >
	            			<button type="submit" class="submit_button1" >登录</button>
	            			<button type="button" class="submit_button2" id="visitor" >游客</button>
	            		</td>
	            	</tr>
	            </table>
            </form>
        </div>
</body>
</html>
    